package edu.ucsb.cs56.W12.chatserver.junit;

import static org.junit.Assert.*;

import org.junit.Test;

import edu.ucsb.cs56.W12.chatserver.model.Server;

/**
 * ServerTester class is the JUnit tests for the Server
 * @author Peng Wang with Andro Stotts
 * @version 0.1
 */

public class ServerTester {
	
	/**
	 * Tests the return of getServer() to see if it is an object of the Server class
	 */
	@Test 
	public void testGetServer() {
		Server server = Server.getServer();
		assertEquals(Server.class, server.getClass());
	}

	/**
	 * Tests getServerStatus()
	 */
	@Test
	public void testGetServerStatus() {
		Server server = Server.getServer();
		server.start();
		assertEquals(true, server.getServerStatus());
	}

	/**
	 * Tests getServerMsg()
	 */
	@Test
	public void testGetServerMsg() {
		Server server = Server.getServer();
		server.start();
		assertEquals("[Server Message] Server started failed", server.getServerMsg());
	}

}
